package healthcheck

import (
	"time"
)

type OperationInfo interface {
	// GetOperationID returns the operation identity
	GetOperationID() int
	// GetUser returns the login user
	GetLoginName() string
	// GetMySQLServerHostIP returns the mysql server host ip
	GetMySQLServerHostIP() string
	// GetMySQLServerPortNum returns the mysql server port number
	GetMySQLServerPortNum() int
	// GetMySQLServerServerName returns the mysql server server name
	GetMySQLServerServerName() string
	// GetMySQLServerServiceName returns the mysql server service name
	GetMySQLServerServiceName() string
	// GetMonitorSystemSystemType returns the system type of the monitor system
	GetMonitorSystemSystemType() int
	// GetMonitorSystemHostIP returns the monitor system host IP
	GetMonitorSystemHostIP() string
	// GetMonitorSystemPortNum returns the monitor system port number
	GetMonitorSystemPortNum() int
	// GetMonitorSystemPortNumSlow returns the monitor system port number for slow log
	GetMonitorSystemPortNumSlow() int
	// GetMonitorSystemBaseURL returns the monitor system base URL
	GetMonitorSystemBaseURL() string
	// GetStartTime returns the start time
	GetStartTime() time.Time
	// GetEndTime returns the end time
	GetEndTime() time.Time
	// GetStep returns the step
	GetStep() time.Duration
	// GetCallbackAddr returns the call back server address
	GetCallbackAddr() string
}

type OperationHistory interface {
	// GetID returns the identity
	GetID() int
	// GetLoginName returns the user login name
	GetLoginName() string
	// GetHostIP returns the host ip of mysql server
	GetHostIP() string
	// GetPortNum returns the port number of mysql server
	GetPortNum() int
	// GetStartTime returns the start time
	GetStartTime() time.Time
	// GetEndTime returns the end time
	GetEndTime() time.Time
	// GetStep returns the step, the unit is seconds
	GetStep() int
	// GetStatus returns the status
	GetStatus() int
	// GetMessage returns the message
	GetMessage() string
	// GetDelFlag returns the delete flag
	GetDelFlag() int
	// GetCreateTime returns the create time
	GetCreateTime() time.Time
	// GetLastUpdateTime returns the last update time
	GetLastUpdateTime() time.Time
}

type ItemConfig interface {
	// GetID returns the identity
	GetID() int
	// GetItemName returns the item name
	GetItemName() string
	// GetItemWeight returns the item weight
	GetItemWeight() int
	// GetLowWatermark returns the low watermark
	GetLowWatermark() float64
	// GetHighWatermark returns the high watermark
	GetHighWatermark() float64
	// GetUnit returns the unit
	GetUnit() float64
	// GetScoreDeductionPerUnitHigh returns the score deduction per unit high
	GetScoreDeductionPerUnitHigh() float64
	// GetMaxScoreDeductionHigh returns the max score deduction high
	GetMaxScoreDeductionHigh() float64
	// GetScoreDeductionPerUnitMedium returns the score deduction per unit medium
	GetScoreDeductionPerUnitMedium() float64
	// GetMaxScoreDeductionMedium returns the max score deduction medium
	GetMaxScoreDeductionMedium() float64
	// GetDelFlag returns the delete flag
	GetDelFlag() int
	// GetCreateTime returns the create time
	GetCreateTime() time.Time
	// GetLastUpdateTime returns the last update time
	GetLastUpdateTime() time.Time
}

type EngineConfig interface {
	// GetItemConfig returns the item config
	GetItemConfig(item string) ItemConfig
	// SetItemConfig sets item config with given item and config
	SetItemConfig(item string, config ItemConfig)
	// Validate validates if engine configuration is valid
	Validate() error
}

type Variable interface {
	// GetName returns the name of the variable
	GetName() string
	// GetName returns the value of the variable
	GetValue() string
}

type Table interface {
	// GetDBName returns the db name
	GetDBName() string
	// GetTableName returns the table name
	GetTableName() string
	// GetTableRows returns the table rows
	GetTableRows() int
	// GetTableSize returns the table size
	GetTableSize() float64
}

type FileSystem interface {
	// GetMountPoint returns the mount point
	GetMountPoint() string
	// GetDevice returns the device
	GetDevice() string
}

type SlaveStatus interface {
	// IsSlave returns if the server is slave
	IsSlave() bool
	// IsRunning returns if the slave thread is running
	IsRunning() bool
}

type PrometheusData interface {
	// GetTimestamp returns the timestamp
	GetTimestamp() string
	// GetValue returns the value
	GetValue() float64
}
